# Replace the line below with the path to the replication directory
REPLICATION_DIR="path_to_replication_directory"

cd "$REPLICATION_DIR"

mkdir working out out/outcomes out/wave1 out/wave2 

cd "$REPLICATION_DIR/code"

Rscript 00_prep_survey.R
Rscript 01_analysis_constraint.R
Rscript 02_analysis_polarization.R
Rscript 03_analysis_stability.R
Rscript 04_analysis_ideology.R
Rscript 05_analysis_treatment_strength.R
Rscript 06_heterogeneous_effects.R

cd "$REPLICATION_DIR/paper"

Rscript -e "rmarkdown::render('manuscript.Rmd')"